home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Game-Power
/
Amiga Game-Power.iso
/
anwendungen
/
gw print
/
structurebrowser_v1.3
/
sources
/
sbgfx.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-20
|
6KB
|
188 lines
/*
Handles the BitMap and RastPort structures
Not implemented:
RastPort.TmpRas
RastPort.AreaInfo
RastPort.GelsInfo
RastPort.Flags
RastPort.TxFlags
*/
#include "header/sb.h"
extern int level;
PrBitMap (string, bitmap)
char *string;
struct BitMap *bitmap;
{
static struct StructData structdata [] = {
{"-BytesPerRow", "UWORD", PRUINT, INTSIZE },
{"-Rows", "UWORD", PRUINT, INTSIZE },
{"-Flags", "UBYTE", PRUBYTE, BYTESIZE },
{"-Depth", "UBYTE", PRUBYTE, BYTESIZE },
{"-Pad", "UWORD", PRUINT, INTSIZE },
{" Planes[8]", "PLANEPTR", PRPTR, PTRSIZE * 8}
};
int i, sum, choice = -1;
level++;
while (choice)
{
sum = SetOptionText(string, structdata, (APTR)bitmap, DATASIZE, 0);
if ((choice = GetChoice(DATASIZE)) == 6)
PrPlanes("BitPlanes belong to the BitMap", bitmap->Planes,
bitmap->Rows, bitmap->BytesPerRow);
}
level--;
}
PrPlanes (string, planes, rows, bytes)
char *string;
PLANEPTR planes[];
UWORD rows, bytes;
{
static struct StructData structdata [] = {
{" BitPlane[0]", "PLANEPTR", PRPTR, PTRSIZE},
{" BitPlane[1]", "PLANEPTR", PRPTR, PTRSIZE},
{" BitPlane[2]", "PLANEPTR", PRPTR, PTRSIZE},
{" BitPlane[3]", "PLANEPTR", PRPTR, PTRSIZE},
{" BitPlane[4]", "PLANEPTR", PRPTR, PTRSIZE},
{" BitPlane[5]", "PLANEPTR", PRPTR, PTRSIZE},
{" BitPlane[6]", "PLANEPTR", PRPTR, PTRSIZE},
{" BitPlane[7]", "PLANEPTR", PRPTR, PTRSIZE}
};
int i, sum, choice = -1;
level++;
while (choice)
{
sum = SetOptionText(string, structdata, (APTR)planes, DATASIZE, 0);
choice = GetChoice(8);
if (choice >= 1 && choice <= 8 && planes[choice - 1])
HexDump(structdata[choice - 1].membername,
planes[choice - 1], PTRSIZE, (long)(rows * bytes));
}
level--;
}
PrRastPort (string, rastport)
char *string;
struct RastPort *rastport;
{
static struct StructData structdata [] = {
{ " Layer", "struct Layer *", PRPTR, PTRSIZE },
{ " BitMap", "struct BitMap *", PRPTR, PTRSIZE },
{ "-Area Ptrn", "USHORT *", PRPTR, PTRSIZE },
{ "(TmpRas", "struct TmpRas *)", PRPTR, PTRSIZE },
{ "(AreaInfo", "struct AreaInfo *)", PRPTR, PTRSIZE },
{ "(GelsInfo", "struct GelsInfo *)", PRPTR, PTRSIZE },
{ "-Mask", "UBYTE", PRUBYTE, BYTESIZE },
{ "-FgPen", "BYTE", PRBYTE, BYTESIZE },
{ "-BgPen", "BYTE", PRBYTE, BYTESIZE },
{ "-AOlPen", "BYTE", PRBYTE, BYTESIZE },
{ "-DrawMode", "BYTE", PRBYTE, BYTESIZE },
{ "-AreaPtSz", "BYTE", PRBYTE, BYTESIZE },
{ "-linpatcnt", "BYTE", PRBYTE, BYTESIZE },
{ "-dummy", "BYTE", PRBYTE, BYTESIZE },
{ "(Flags", "USHORT)", PRUBYTE, INTSIZE },
{ "-LinePtrn", "USHORT", PRUBYTE, INTSIZE }
};
int i, sum, choice = -1;
level++;
while (choice)
{
sum = SetOptionText(string, structdata, (APTR)rastport, DATASIZE, 0);
switch (choice = GetChoice(MAXGADG + 1))
{
case 1:
if (rastport->Layer)
PrLayer("The Layer for this RastPort", rastport->Layer);
break;
case 2:
if (rastport->BitMap)
PrBitMap("The BitMap for this RastPort", rastport->BitMap);
break;
case MOREGADG:
PrRastPort2("More RastPort members", rastport, sum);
break;
}
}
level--;
}
PrRastPort2 (string, rastport, offset)
char *string;
struct RastPort *rastport;
int offset;
{
static struct StructData structdata[] = {
{ "-cp_x", "SHORT", PRINT, INTSIZE },
{ "-cp_y", "SHORT", PRINT, INTSIZE },
{ " minterms[8]", "UBYTE", PRNULL, BYTESIZE * 8},
{ "-PenWidth", "SHORT", PRINT, INTSIZE },
{ "-PenHeight", "SHORT", PRINT, INTSIZE },
{ " Font", "struct TextFont *", PRPTR, PTRSIZE },
{ "-AlgoStyle", "UBYTE", PRUBYTE, BYTESIZE },
{ "(TxFlags", "UBYTE)", PRUBYTE, BYTESIZE },
{ "-TxHeight", "UWORD", PRUINT, INTSIZE },
{ "-TxWidth", "UWORD", PRUINT, INTSIZE },
{ "-TxBaseline", "UWORD", PRUINT, INTSIZE },
{ "-TxSpacing", "WORD", PRINT, INTSIZE },
{ "-RP_User", "WORD", PRINT, INTSIZE },
{ " wordreserved[7]", "UWORD", PRNULL, INTSIZE * 7 },
{ " longreserved[2]", "ULONG", PRNULL, PTRSIZE * 2 },
{ " reserved[8]", "UBYTE", PRNULL, BYTESIZE * 8}
};
int i, sum;
int choice = -1;
level++;
while (choice)
{
sum = SetOptionText(string, structdata,
(APTR)rastport, DATASIZE, offset);
switch (choice = GetChoice(DATASIZE))
{
case 3:
HexDump("Hexdump of RastPort minterms bytes",
&rastport->minterms[0], BYTESIZE, (long)BYTESIZE * 8);
break;
case 6:
if (rastport->Font)
PrTextFont("This RastPort's TextFont structure",
rastport->Font);
break;
case 14:
HexDump("Hexdump of reserved RastPort words",
&rastport->wordreserved[0], INTSIZE, (long)INTSIZE * 7);
break;
case 15:
HexDump("Hexdump of reserved RastPort longwords",
&rastport->longreserved[0], PTRSIZE, (long)PTRSIZE * 2);
break;
case 16:
HexDump("Hexdump of reserved RastPort bytes",
&rastport->reserved[0], BYTESIZE, (long)BYTESIZE * 8);
break;
}
}
level--;
}